package com.boot.web;

import com.boot.mapper.SpotCheckType1Mapper;
import com.boot.mapper.SpotCheckTypeCopyMapper;
import com.boot.service.FourService;
import com.boot.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author pan zhang
 */

@RestController
@RequestMapping(value = "/4")
public class ScreenFourthController {


    @Autowired
    private FourService fourService;

    @Autowired
    private SpotCheckTypeCopyMapper spotCheckTypeCopyMapper;

    @Autowired
    private SpotCheckType1Mapper spotCheckType1Mapper;


    @GetMapping("1")
    public String getData1() {
        return JsonUtil.serialize(fourService.getSpotChecks());

    }

    @GetMapping("2")
    public String getData2() {
        return JsonUtil.serialize(fourService.getQualificationRates());

    }

    @GetMapping("3")
    public String getData3() {
        return JsonUtil.serialize(fourService.getSpotCheckTypes());

    }

    @GetMapping("3/1")
    public String getData32() {
        return JsonUtil.serialize(spotCheckType1Mapper.selectAll());

    }

    @GetMapping("3/2")
    public String getData31() {
        return JsonUtil.serialize(spotCheckTypeCopyMapper.selectAll());

    }

    @GetMapping("4")
    public String getData4() {
        return JsonUtil.serialize(fourService.getProductTestings());

    }

    @GetMapping("5")
    public String getData5() {
        return JsonUtil.serialize(fourService.getProductTestingResults());

    }


}